package com.tongtech.system.domain;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.tongtech.common.core.web.domain.BaseEntity;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

import java.util.Date;
import java.util.List;

/**
 * 工单表 workOrder
 *
 * @author xingyc
 */
public class WorkOrder extends BaseEntity
{
    private static final long serialVersionUID = 1L;

    /** 创建人的用户id */
    private Long userId;

    /** 创建人的部门id */
    private Long deptId;

    /** 工单id */
    private Long workOrderId;

    /** 工单名称 */
    private String name;

    /** 工单类型，多层结构 */
    private Long type;

    /** 工单类型名称 */
    private String typeName;

    /** 项目ID */
    private Long projectId;

    /** 项目名称 */
    private String projectName;

    /** 环境 0-生产 1-非生产 */
    private String environment;

    /** 销售ID，来源于用户ID */
    private Long marketerId;

    /** 销售姓名 */
    private String marketerName;

    /** 客户联系人 */
    private String contacts;

    /** 客户电话 */
    private String phone;

    /** 客户邮箱 */
    private String email;

    /** 产品ID */
    private Long productId;

    /** 产品名称 */
    private String productName;

    private String[] dateRange;

    /** 开始时间 */
    @JsonFormat(pattern = "yyyy-MM-dd")
    private Date startTime;

    /** 结束时间 */
    @JsonFormat(pattern = "yyyy-MM-dd")
    private Date endTime;

    /** 支持方式 0-远程 1-现场 */
    private String supportMethod;

    /** 订单状态，数据字典 */
    private String orderStatus;

    /** 现场工作地点 */
    private String address;

    /** 描述 */
    private String desc;

    /** 工单状态:0-正常,1-停用 */
    private String status;

    /** 删除标志（0代表存在 2代表删除） */
    private String delFlag;

    /** 支持人员ID（userId） */
    private Long supportPersonnelId;

    private List<WorkOrderSupport> supports;

    public Long getUserId() {
        return userId;
    }

    public void setUserId(Long userId) {
        this.userId = userId;
    }

    public Long getDeptId() {
        return deptId;
    }

    public void setDeptId(Long deptId) {
        this.deptId = deptId;
    }

    public Long getWorkOrderId() {
        return workOrderId;
    }

    public void setWorkOrderId(Long workOrderId) {
        this.workOrderId = workOrderId;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }


    public String getEnvironment() {
        return environment;
    }

    public void setEnvironment(String environment) {
        this.environment = environment;
    }

    public String getMarketerName() {
        return marketerName;
    }

    public void setMarketerName(String marketerName) {
        this.marketerName = marketerName;
    }

    public String getContacts() {
        return contacts;
    }

    public void setContacts(String contacts) {
        this.contacts = contacts;
    }

    public String getPhone() {
        return phone;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }

    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    public Long getType() {
        return type;
    }

    public void setType(Long type) {
        this.type = type;
    }

    public String getTypeName() {
        return typeName;
    }

    public void setTypeName(String typeName) {
        this.typeName = typeName;
    }

    public Long getProjectId() {
        return projectId;
    }

    public void setProjectId(Long projectId) {
        this.projectId = projectId;
    }

    public Long getMarketerId() {
        return marketerId;
    }

    public void setMarketerId(Long marketerId) {
        this.marketerId = marketerId;
    }

    public Long getProductId() {
        return productId;
    }

    public void setProductId(Long productId) {
        this.productId = productId;
    }

    public String[] getDateRange() {
        return dateRange;
    }

    public void setDateRange(String[] dateRange) {
        this.dateRange = dateRange;
    }

    public Date getStartTime() {
        return startTime;
    }

    public void setStartTime(Date startTime) {
        this.startTime = startTime;
    }

    public Date getEndTime() {
        return endTime;
    }

    public void setEndTime(Date endTime) {
        this.endTime = endTime;
    }

    public String getSupportMethod() {
        return supportMethod;
    }

    public void setSupportMethod(String supportMethod) {
        this.supportMethod = supportMethod;
    }

    public String getAddress() {
        return address;
    }

    public void setAddress(String address) {
        this.address = address;
    }

    public String getOrderStatus() {
        return orderStatus;
    }

    public void setOrderStatus(String orderStatus) {
        this.orderStatus = orderStatus;
    }

    public String getDesc() {
        return desc;
    }

    public void setDesc(String desc) {
        this.desc = desc;
    }

    public String getStatus() {
        return status;
    }

    public void setStatus(String status) {
        this.status = status;
    }

    public String getDelFlag() {
        return delFlag;
    }

    public void setDelFlag(String delFlag) {
        this.delFlag = delFlag;
    }

    public String getProjectName() {
        return projectName;
    }

    public void setProjectName(String projectName) {
        this.projectName = projectName;
    }

    public String getProductName() {
        return productName;
    }

    public void setProductName(String productName) {
        this.productName = productName;
    }

    public List<WorkOrderSupport> getSupports() {
        return supports;
    }

    public void setSupports(List<WorkOrderSupport> supports) {
        this.supports = supports;
    }

    public Long getSupportPersonnelId() {
        return supportPersonnelId;
    }

    public void setSupportPersonnelId(Long supportPersonnelId) {
        this.supportPersonnelId = supportPersonnelId;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
            .append("workOrderId", getWorkOrderId())
            .append("name", getName())
            .append("type", getType())
            .append("projectId", getProjectId())
            .append("environment", getEnvironment())
            .append("marketerId", getMarketerId())
            .append("contacts", getContacts())
            .append("phone", getPhone())
            .append("email", getEmail())
            .append("productId", getProductId())
             .append("dateRange", getDateRange())
            .append("startTime", getStartTime())
            .append("endTime", getEndTime())
            .append("supportMethod", getSupportMethod())
            .append("orderStatus", getOrderStatus())
            .append("address", getAddress())
             .append("supports", getSupports())
            .append("desc", getDesc())
            .append("status", getStatus())
            .append("delFlag", getDelFlag())
            .append("createBy", getCreateBy())
            .append("createTime", getCreateTime())
            .append("updateBy", getUpdateBy())
            .append("updateTime", getUpdateTime())
            .toString();
    }
}
